ZIP 密碼保護
對 ZIP 壓縮檔案進行密碼保護是指為壓縮檔案添加密碼以保護其內容。 這樣可以確保只有擁有正確密碼的使用者才能提取或存取 ZIP 壓縮包中的檔案。此密碼起到加密作用,防止未經授權的使用者存取壓縮包中儲存的檔案。要從受密碼保護的 ZIP 壓縮包中提取文件,使用者必須輸入正確的密碼。
準備好開始了嗎?
Nuget 下載 19,717 | 版本: 2026.4 剛剛發布
using IronZip;
using IronZip.Enum;
// Create empty ZIP with highest compression
using (var archive = new IronZipArchive(9))
{
// Password protect the ZIP (Support AES128 & AES256)
archive.Encrypt("P@ssw0rd", EncryptionMethods.Traditional);
archive.Add("./assets/image1.jpg");
archive.Add("./assets/image2.jpg");
// Export the ZIP
archive.SaveAs("output.zip");
}
Imports IronZip
Imports IronZip.Enum
' Create empty ZIP with highest compression
Using archive = New IronZipArchive(9)
' Password protect the ZIP (Support AES128 & AES256)
archive.Encrypt("P@ssw0rd", EncryptionMethods.Traditional)
archive.Add("./assets/image1.jpg")
archive.Add("./assets/image2.jpg")
' Export the ZIP
archive.SaveAs("output.zip")
End Using
Install-Package IronZip
對 ZIP 壓縮檔案進行密碼保護是指為壓縮檔案添加密碼以保護其內容。 這樣可以確保只有擁有正確密碼的使用者才能提取或存取 ZIP 壓縮包中的檔案。此密碼起到加密作用,防止未經授權的使用者存取壓縮包中儲存的檔案。要從受密碼保護的 ZIP 壓縮包中提取文件,使用者必須輸入正確的密碼。